package model.components.nodes.node;

public class PhysicalRouter extends PhysicalNode
{
	public static final String NAME_PREFIX = "PhysicalRouter";

	public PhysicalRouter( String networkName, int number, String operatingSystem, String virtualEnvironment, int cpu, int memory, int maxVirtualNodesNumber )
	{
		super( networkName, PhysicalRouter.NAME_PREFIX, number, Node.ROUTER_TYPE, operatingSystem, virtualEnvironment, cpu, memory, maxVirtualNodesNumber, Node.GREY_ROUTER, Node.GREEN_ROUTER, Node.YELLOW_ROUTER, Node.RED_ROUTER );
	}
	
	@Override
	public PhysicalRouter getCopy()
	{		
		PhysicalRouter physicalRouter = new PhysicalRouter( this.getNetworkName(), this.getNumber(), this.getOperatingSystem(), this.getVirtualEnvironment(), this.getCpu(), this.getMemory(), this.getAvailableVirtualNodesNumber() );
		physicalRouter.setInitialNumber( this.getInitialNumber() );
		physicalRouter.setNamePrefix( this.getNamePrefix() );
		physicalRouter.setType( this.getType() );
		physicalRouter.setAvailableCpu( this.getAvailableCpu() );
		physicalRouter.setAvailableMemory( this.getAvailableMemory() );
		physicalRouter.setMaxVirtualNodesNumber( this.getMaxVirtualNodesNumber() );
		physicalRouter.setTimeStamp( this.getTimeStamp() );
		physicalRouter.setSelected( this.isSelected() );
		
		for( VirtualNode virtualNode: this.getVirtualNodes() )
			physicalRouter.add( virtualNode.getCopy() );
		
		return physicalRouter;
	}

}
